module First_patched_version = struct
  type t = { identifier : string } [@@deriving yojson { strict = false; meta = true }, show, eq]
end

module Severity = struct
  let t_of_yojson = function
    | `String "low" -> Ok "low"
    | `String "medium" -> Ok "medium"
    | `String "high" -> Ok "high"
    | `String "critical" -> Ok "critical"
    | json -> Error ("Unknown value: " ^ Yojson.Safe.pretty_to_string json)

  type t = (string[@of_yojson t_of_yojson])
  [@@deriving yojson { strict = false; meta = true }, show, eq]
end

type t = {
  first_patched_version : First_patched_version.t option; [@default None]
  package : Githubc2_components_dependabot_alert_package.t;
  severity : Severity.t;
  vulnerable_version_range : string;
}
[@@deriving yojson { strict = false; meta = true }, show, eq]
